import 'package:cbec_app/generated/json/base/json_convert_content.dart';
import 'package:cbec_app/entity/home/content/new_zone__entity.dart';

NewZoneEntity $NewZoneEntityFromJson(Map<String, dynamic> json) {
  final NewZoneEntity newZoneEntity = NewZoneEntity();
  final String? marketingId = jsonConvert.convert<String>(json['marketingId']);
  if (marketingId != null) {
    newZoneEntity.marketingId = marketingId;
  }
  final String? goodsId = jsonConvert.convert<String>(json['goodsId']);
  if (goodsId != null) {
    newZoneEntity.goodsId = goodsId;
  }
  final double? seckillPrice = jsonConvert.convert<double>(json['seckillPrice']);
  if (seckillPrice != null) {
    newZoneEntity.seckillPrice = seckillPrice;
  }
  final double? discount = jsonConvert.convert<double>(json['discount']);
  if (discount != null) {
    newZoneEntity.discount = discount;
  }
  final int? storage = jsonConvert.convert<int>(json['storage']);
  if (storage != null) {
    newZoneEntity.storage = storage;
  }
  final double? soldRatio = jsonConvert.convert<double>(json['soldRatio']);
  if (soldRatio != null) {
    newZoneEntity.soldRatio = soldRatio;
  }
  final dynamic spuSpecJsonBody = json['spuSpecJsonBody'];
  if (spuSpecJsonBody != null) {
    newZoneEntity.spuSpecJsonBody = spuSpecJsonBody;
  }
  final String? skuCode = jsonConvert.convert<String>(json['skuCode']);
  if (skuCode != null) {
    newZoneEntity.skuCode = skuCode;
  }
  final String? barCode = jsonConvert.convert<String>(json['barCode']);
  if (barCode != null) {
    newZoneEntity.barCode = barCode;
  }
  final String? commodityName = jsonConvert.convert<String>(json['commodityName']);
  if (commodityName != null) {
    newZoneEntity.commodityName = commodityName;
  }
  final int? status = jsonConvert.convert<int>(json['status']);
  if (status != null) {
    newZoneEntity.status = status;
  }
  final int? number = jsonConvert.convert<int>(json['number']);
  if (number != null) {
    newZoneEntity.number = number;
  }
  final int? commodityType = jsonConvert.convert<int>(json['commodityType']);
  if (commodityType != null) {
    newZoneEntity.commodityType = commodityType;
  }
  final int? commoditySource = jsonConvert.convert<int>(json['commoditySource']);
  if (commoditySource != null) {
    newZoneEntity.commoditySource = commoditySource;
  }
  final int? commodityForm = jsonConvert.convert<int>(json['commodityForm']);
  if (commodityForm != null) {
    newZoneEntity.commodityForm = commodityForm;
  }
  final String? supplierName = jsonConvert.convert<String>(json['supplierName']);
  if (supplierName != null) {
    newZoneEntity.supplierName = supplierName;
  }
  final String? className = jsonConvert.convert<String>(json['className']);
  if (className != null) {
    newZoneEntity.className = className;
  }
  final String? brandName = jsonConvert.convert<String>(json['brandName']);
  if (brandName != null) {
    newZoneEntity.brandName = brandName;
  }
  final double? taxRate = jsonConvert.convert<double>(json['taxRate']);
  if (taxRate != null) {
    newZoneEntity.taxRate = taxRate;
  }
  final double? highTaxRate = jsonConvert.convert<double>(json['highTaxRate']);
  if (highTaxRate != null) {
    newZoneEntity.highTaxRate = highTaxRate;
  }
  final double? highPrice = jsonConvert.convert<double>(json['highPrice']);
  if (highPrice != null) {
    newZoneEntity.highPrice = highPrice;
  }
  final double? price = jsonConvert.convert<double>(json['price']);
  if (price != null) {
    newZoneEntity.price = price;
  }
  final String? image = jsonConvert.convert<String>(json['image']);
  if (image != null) {
    newZoneEntity.image = image;
  }
  final String? mainImage = jsonConvert.convert<String>(json['mainImage']);
  if (mainImage != null) {
    newZoneEntity.mainImage = mainImage;
  }
  final dynamic paySingle = json['paySingle'];
  if (paySingle != null) {
    newZoneEntity.paySingle = paySingle;
  }
  final int? activityStatus = jsonConvert.convert<int>(json['activityStatus']);
  if (activityStatus != null) {
    newZoneEntity.activityStatus = activityStatus;
  }
  final List<dynamic>? discountLabel = (json['discountLabel'] as List<dynamic>?)?.map((e) => e).toList();
  if (discountLabel != null) {
    newZoneEntity.discountLabel = discountLabel;
  }
  return newZoneEntity;
}

Map<String, dynamic> $NewZoneEntityToJson(NewZoneEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['marketingId'] = entity.marketingId;
  data['goodsId'] = entity.goodsId;
  data['seckillPrice'] = entity.seckillPrice;
  data['discount'] = entity.discount;
  data['storage'] = entity.storage;
  data['soldRatio'] = entity.soldRatio;
  data['spuSpecJsonBody'] = entity.spuSpecJsonBody;
  data['skuCode'] = entity.skuCode;
  data['barCode'] = entity.barCode;
  data['commodityName'] = entity.commodityName;
  data['status'] = entity.status;
  data['number'] = entity.number;
  data['commodityType'] = entity.commodityType;
  data['commoditySource'] = entity.commoditySource;
  data['commodityForm'] = entity.commodityForm;
  data['supplierName'] = entity.supplierName;
  data['className'] = entity.className;
  data['brandName'] = entity.brandName;
  data['taxRate'] = entity.taxRate;
  data['highTaxRate'] = entity.highTaxRate;
  data['highPrice'] = entity.highPrice;
  data['price'] = entity.price;
  data['image'] = entity.image;
  data['mainImage'] = entity.mainImage;
  data['paySingle'] = entity.paySingle;
  data['activityStatus'] = entity.activityStatus;
  data['discountLabel'] = entity.discountLabel;
  return data;
}

extension NewZoneEntityExtension on NewZoneEntity {
  NewZoneEntity copyWith({
    String? marketingId,
    String? goodsId,
    double? seckillPrice,
    double? discount,
    int? storage,
    double? soldRatio,
    dynamic spuSpecJsonBody,
    String? skuCode,
    String? barCode,
    String? commodityName,
    int? status,
    int? number,
    int? commodityType,
    int? commoditySource,
    int? commodityForm,
    String? supplierName,
    String? className,
    String? brandName,
    double? taxRate,
    double? highTaxRate,
    double? highPrice,
    double? price,
    String? image,
    String? mainImage,
    dynamic paySingle,
    int? activityStatus,
    List<dynamic>? discountLabel,
  }) {
    return NewZoneEntity()
      ..marketingId = marketingId ?? this.marketingId
      ..goodsId = goodsId ?? this.goodsId
      ..seckillPrice = seckillPrice ?? this.seckillPrice
      ..discount = discount ?? this.discount
      ..storage = storage ?? this.storage
      ..soldRatio = soldRatio ?? this.soldRatio
      ..spuSpecJsonBody = spuSpecJsonBody ?? this.spuSpecJsonBody
      ..skuCode = skuCode ?? this.skuCode
      ..barCode = barCode ?? this.barCode
      ..commodityName = commodityName ?? this.commodityName
      ..status = status ?? this.status
      ..number = number ?? this.number
      ..commodityType = commodityType ?? this.commodityType
      ..commoditySource = commoditySource ?? this.commoditySource
      ..commodityForm = commodityForm ?? this.commodityForm
      ..supplierName = supplierName ?? this.supplierName
      ..className = className ?? this.className
      ..brandName = brandName ?? this.brandName
      ..taxRate = taxRate ?? this.taxRate
      ..highTaxRate = highTaxRate ?? this.highTaxRate
      ..highPrice = highPrice ?? this.highPrice
      ..price = price ?? this.price
      ..image = image ?? this.image
      ..mainImage = mainImage ?? this.mainImage
      ..paySingle = paySingle ?? this.paySingle
      ..activityStatus = activityStatus ?? this.activityStatus
      ..discountLabel = discountLabel ?? this.discountLabel;
  }
}
